//
//  LocationManager.m
//  hai游～
//
//  Created by jakf_17 on 15/5/26.
//  Copyright (c) 2015年 jakf_17. All rights reserved.
//

#import "LocationManager.h"

@implementation LocationManager


- (instancetype)init
{
    self = [super init];
    if (self) {
        
    }
    return self;
}


- (void)createMylocation
{
    self.manager = [[CLLocationManager alloc] init];
    _manager.delegate = self;
    _manager.desiredAccuracy = kCLLocationAccuracyBest;
    _manager.distanceFilter = 100;
    [_manager startUpdatingLocation];
}

- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
    CLLocation *currentLocation = [locations lastObject];
    CLLocationCoordinate2D coordinate = currentLocation.coordinate;
    [self.delegate getLocation:coordinate];
    [_manager stopUpdatingLocation];
}
@end
